<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var arr = [8, 10, 6, 17, 24, 2, 8, 8, 33, 8, 10, 17];
      for (var i = 0; i < arr.length; i++) {
        for (var j = i + 1; j < arr.length; j++) {
          // 判断 我们假设的这个元素在数组中是否有重复
          if (arr[i] === arr[j]) {
            // 将重复元素删除
            arr.splice(j, 1);
            j--;
          }
        }
      }
      console.log(arr);
    </script>
  </body>
</html>
